﻿using System;

using Xc.DataAccess.Docs.MarkDowns;

namespace Xc.DataAccess.Docs.Services
{
    /// <summary>
    /// 写入上下文
    /// </summary>
    public interface IWriteContextService
    {
        /// <summary>
        /// 写粗体
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendBold(string content);
        /// <summary>
        /// 写粗体
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendBoldLine(string content);
        /// <summary>
        /// 写代码
        /// </summary>
        /// <param name="languange"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendCode(string languange, string content);
        /// <summary>
        /// 写代码
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        IWriteContextService AppendCodeSimple(string code);
        /// <summary>
        /// 写表格
        /// </summary>
        /// <param name="dataTable"></param>
        /// <returns></returns>
        IWriteContextService AppendDataTable(MarkDataTable dataTable);
        /// <summary>
        /// 写删除
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendDelete(string content);
        /// <summary>
        /// 字符串
        /// </summary>
        string Text { get; }
        /// <summary>
        /// 写一行
        /// </summary>
        /// <param name="isNewLine"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendLine(bool isNewLine, params string[] content);
        /// <summary>
        /// 附加标题行
        /// </summary>
        /// <param name="level"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendHead(int level, string content);
        /// <summary>
        /// 附加水平分割线
        /// </summary>
        /// <returns></returns>
        IWriteContextService AppendHorizontalLine();
        /// <summary>
        /// 附加图像
        /// </summary>
        /// <param name="title"></param>
        /// <param name="path"></param>
        /// <param name="tips"></param>
        /// <returns></returns>
        IWriteContextService AppendImage(string title, string path, string tips);
        /// <summary>
        /// 写斜体
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendItalic(string content);
        /// <summary>
        /// 写斜体 一行
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendItalicLine(string content);
        /// <summary>
        /// 添加一个超连接
        /// </summary>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <param name="tips"></param>
        /// <returns></returns>
        IWriteContextService AppendLink(string title, string content, string tips);
        /// <summary>
        /// 添加一个网址
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        IWriteContextService AppendUrl(string url);
        /// <summary>
        /// 添加有序列表
        /// </summary>
        /// <param name="number"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendOrderList(int number, string content);
        /// <summary>
        /// 添加任务
        /// </summary>
        /// <param name="isCheck"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendTask(bool isCheck, string content);
        /// <summary>
        /// 写无序列表
        /// </summary>
        /// <param name="prefix"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendUnderOrderList(string prefix, string content);
        /// <summary>
        /// 写一行
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendLine(Action<IWriteContextService> content);
        /// <summary>
        /// 写一行
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendLine(params string[] content);
        /// <summary>
        /// 写一小段
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService Append(params string[] content);
        /// <summary>
        /// 写引用
        /// </summary>
        /// <param name="level"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendRef(int level, params string[] content);
        /// <summary>
        /// 写引用
        /// </summary>
        /// <param name="level"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendRefLine(int level, params string[] content);
        /// <summary>
        /// 写删除
        /// </summary>
        /// <param name="content"></param>
        /// <returns></returns>
        IWriteContextService AppendDeleteLine(string content);
        /// <summary>
        /// 写表格
        /// </summary>
        /// <param name="dataTable"></param>
        /// <returns></returns>
        IWriteContextService AppendDataTable(Action<MarkDataTable> dataTable);
        void SaveToFile(string fileName);
        IWriteContextService AppendHead(int level, Action<IWriteContextService> callBack);
        IWriteContextService AppendBoldItalicLine(string content);
        IWriteContextService AppendCode(string languange, Action<IWriteContextService> content);
    }
}